package com.cms.admin.service.employee.impl;

import java.util.List;

import com.cms.admin.mapper.DepartmentListMapper;
import com.cms.admin.model.DepartmentList;
import com.cms.admin.model.DepartmentListExt;
import com.cms.admin.model.PageBean;
import com.cms.admin.service.employee.DepartmentListService;
 
public class DepartmentListServiceImpl implements DepartmentListService {

	
	private DepartmentListMapper departmentListMapper;
	
	 

	/**
	 * @return the departmentMapper
	 */
	public DepartmentListMapper getDepartmentListMapper() {
		return departmentListMapper;
	}

	/**
	 * @param departmentMapper the departmentMapper to set
	 */
	public void setDepartmentListMapper(DepartmentListMapper departmentListMapper) {
		this.departmentListMapper = departmentListMapper;
	}

	@Override
	public int getRowCount(DepartmentListExt search) {
		// TODO Auto-generated method stub
		return departmentListMapper.getRowCount(search);
	}

	@Override
	public int deleteByPrimaryKey(Integer deptNo) {
		// TODO Auto-generated method stub
		return departmentListMapper.deleteByPrimaryKey(deptNo);
	}

	@Override
	public int insert(DepartmentList record) {
		// TODO Auto-generated method stub
		return departmentListMapper.insert(record);
	}



	@Override
	public int updateByPrimaryKey(DepartmentList record) {
		// TODO Auto-generated method stub
		return departmentListMapper.updateByPrimaryKey(record);
	}

	@Override
	public List<DepartmentList> selectByCondition(PageBean page, DepartmentListExt search) {
		int count=getRowCount(search);
		page.setAllRow(count);
		//System.out.println("�ܼ�¼����"+count);
		//��ѯʱ��Ϊ���ܷ�ҳʱ��Ҫ��������ѯ���ԶԲ�ѯ�����������¸�ֵ
		
		search.setOffset(page.getOffset());
		search.setPageSize(page.getPageSize());
		//System.out.println("��ѯ����1��"+search.getCondition1());
		//System.out.println("��ѯ����2��"+search.getCondition2()+"---");
		//System.out.println("��ѯ����3��"+search.getCondition3());
		// TODO Auto-generated method stub
		return departmentListMapper.selectByCondition(search);
	}

	@Override
	public List<DepartmentList> getAllRows() {
		// TODO Auto-generated method stub
		return departmentListMapper.getAllRows();
	}
 

	@Override
	public List<DepartmentList> getCurrRoleAllRows(List<Integer> deptNos) {
		// TODO Auto-generated method stub
		
	 
		return departmentListMapper.getCurrRoleAllRows(deptNos);
	}

	@Override
	public DepartmentList selectByName(String deptName) {
		// TODO Auto-generated method stub
		return departmentListMapper.selectByName(deptName);
	}

}
